package cn.crm.bean;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CustService entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "CS_CUSTSERVICE")
public class CustService implements java.io.Serializable {

	// Fields

	private Integer csId;
	private User user;
	private Customer cust;
	private DDL DDLByTypeEffect;
	private DDL DDLByTypeServicetype;
	private DDL DDLByTypeServicestyle;
	private Date csServicetime;
	private String csOther;
	private Boolean csIsdlete;

	// Constructors

	/** default constructor */
	public CustService() {
	}

	/** full constructor */
	public CustService(User user, DDL DDLByTypeEffect,
			DDL DDLByTypeServicetype, DDL DDLByTypeServicestyle,
			Date csServicetime, String csOther, Boolean csIsdlete) {
		this.user = user;
		this.DDLByTypeEffect = DDLByTypeEffect;
		this.DDLByTypeServicetype = DDLByTypeServicetype;
		this.DDLByTypeServicestyle = DDLByTypeServicestyle;
		this.csServicetime = csServicetime;
		this.csOther = csOther;
		this.csIsdlete = csIsdlete;
	}

	// Property accessors
	@SequenceGenerator(name = "generator",sequenceName="seq_custService_id ")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "CS_ID", unique = true, nullable = false, precision = 8, scale = 0)
	public Integer getCsId() {
		return this.csId;
	}

	public void setCsId(Integer csId) {
		this.csId = csId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "US_CREATEEMP")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TYPE_EFFECT")
	public DDL getDDLByTypeEffect() {
		return this.DDLByTypeEffect;
	}

	public void setDDLByTypeEffect(DDL DDLByTypeEffect) {
		this.DDLByTypeEffect = DDLByTypeEffect;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TYPE_SERVICETYPE")
	public DDL getDDLByTypeServicetype() {
		return this.DDLByTypeServicetype;
	}

	public void setDDLByTypeServicetype(DDL DDLByTypeServicetype) {
		this.DDLByTypeServicetype = DDLByTypeServicetype;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TYPE_SERVICESTYLE")
	public DDL getDDLByTypeServicestyle() {
		return this.DDLByTypeServicestyle;
	}

	public void setDDLByTypeServicestyle(DDL DDLByTypeServicestyle) {
		this.DDLByTypeServicestyle = DDLByTypeServicestyle;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CS_SERVICETIME", length = 7)
	public Date getCsServicetime() {
		return this.csServicetime;
	}

	public void setCsServicetime(Date csServicetime) {
		this.csServicetime = csServicetime;
	}

	@Column(name = "CS_OTHER", length = 120)
	public String getCsOther() {
		return this.csOther;
	}

	public void setCsOther(String csOther) {
		this.csOther = csOther;
	}

	@Column(name = "CS_ISDLETE", precision = 1, scale = 0)
	public Boolean getCsIsdlete() {
		return this.csIsdlete;
	}

	public void setCsIsdlete(Boolean csIsdlete) {
		this.csIsdlete = csIsdlete;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CUST_CID")
	public Customer getCust() {
		return cust;
	}

	public void setCust(Customer cust) {
		this.cust = cust;
	}
	
	

}